﻿using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Runtime.Serialization;

using SynapseGaming.LightingSystem.Core;
using SynapseGaming.LightingSystem.Editor;
using SynapseGaming.LightingSystem.Lights;
using SynapseGaming.LightingSystem.Rendering;

using Jitter;
using Jitter.Collision;
using Jitter.Collision.Shapes;
using Jitter.Dynamics;
using Jitter.Forces;
using Jitter.LinearMath;

namespace SunburnJitter
{
    /// <summary>
    /// Component for static triangle meshes
    /// </summary>
    public class TriangleMeshRigidBodyComponent : RigidBodyComponent
    { 
        public TriangleMeshRigidBodyComponent()
        {
        }

        public override void OnInitialize()
        {
            RigidBody = new RigidBody(JitterCollisionManager.Instance.ConstructTriangleMesh(ParentObject));
            RigidBody.IsStatic = true;
            base.OnInitialize();
            RigidBody.Position = startPosition.ToJVector();
        }

        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
        }

        public override void SetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.SetObjectData(info, context);
        }
    }
}
